#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int main() {
    int x, n;
    scanf("%d %d", &x, &n);
    int m = 0;
    for (int i = 1; i <= n; i++) {
        if (x % 7 != 0 && x % 7 != 6) {
            m += 250;
        }
        x++;
    }
    printf("%d", m);
    return 0;
}